import observe from "./observe"
function defineReactiveData(data,key,value){
    observe(value) // value 可能还是对象，需要递归去观测
    Object.defineProperty(data,key,{
        get(){
            console.log('get',value)
            return value
        },
        set(newValue){
            console.log('set',newValue)
            if (newValue == value) return
            observe(newValue) // newValue 可能还是对象，需要递归去观测
            value = newValue
        }
    })
}

export default defineReactiveData